for i in range(1,10):   
    for j in range(1,10):
        # if j>i:
        #     continue
        print(f'{i}*{j}={i*j}',end=' ')
    print('\n')    
    
print('='*60)
for i in range(9,0,-1):
    for j in range(9,0,-1):
        if j<=0 or j>i:
           continue
        print(f'{i}*{j}={i*j}',end=' ')
    print('\n')        
print('='*60)

for i in range(1,10):
    for j in range(9,0,-1):
        if j>i and i*j>=10:
           print(" "*7,end="")
        elif j>i and i*j<10:
           print(" "*7,end="") 
        else:
            print(f'{i}*{j}={i*j}',end=' ')
    print('\n')    
        